var screen = ['main','barracks','stable','smith','place', 'market', 'statue', 'farm'];
var plNames = ['Ratusz', 'Koszary', 'Stajnia', 'Kuźnia', 'Plac', 'Rynek', 'Piedestał', 'Zagroda'];
var menu = document.createElement('div');
//menu.style.height = '15px';
menu.className = 'box menu';


for(var i=0; i<screen.length; i++){
	var currentVillage = document.getElementById('menu_row').childNodes[1].childNodes[0].href.slice(41, 47);
//---------------
	var link = document.createElement('a');
	link.href = '/game.php?village='+currentVillage+'&screen='+screen[i];
//---------------
	var img = document.createElement('img');
	img.src = 'http://pl51.plemiona.pl/graphic/buildings/'+screen[i]+'.png';
	img.style.erticalAlign = 'middle';
	img.style.width = '15px';
	img.style.margin = '0px 2px 0px 2px';
//---------------
	var badge = document.createElement('p'); 
	badge.innerHTML = plNames[i];
	badge.style.margin= '2px';
//---------------
	var thumbnail = document.createElement('div');
	thumbnail.style.cssFloat= 'left';
	thumbnail.appendChild(img);
//	thumbnail.appendChild(badge);
//---------------
	link.appendChild(thumbnail);
	link.style.verticalAlign = 'middle';
//---------------
/*
	var linkC = document.createElement('div');
	linkC.style.width = '44px';
	linkC.style.height = '45px';
	linkC.style.cssFloat = 'left';
	linkC.appendChild(link);
*/
//---------------
	menu.appendChild(link);
//---------------
	document.getElementById('menu_row2').appendChild(menu);
}
